home *** CD-ROM | disk | FTP | other *** search
/ Stone Design / Stone Design.iso / Stone_Friends / Wave / WavesWorld / Source / IBPalettes / WW3DKit / smoothst.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-22  |  218 b   |  13 lines

  1. #include "proctext.h"
  2.  
  3. float
  4. smoothstep(float a, float b, float x)
  5. {
  6.     if (x < a)
  7.         return 0;
  8.     if (x >= b)
  9.         return 1;
  10.     x = (x - a)/(b - a); /* normalize to [0:1] */
  11.     return (x*x * (3 - 2*x));
  12. }
  13.